package com.pactera.asmp.server.service;

import com.pactera.asmp.server.entity.*;
import com.pactera.asmp.server.pojo.ScriptInfo2;
import com.pactera.asmp.server.utils.PageDataResult;
import com.pactera.asmp.server.vo.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

public interface TaskService {

    PageDataResult getTaskList(TaskSearchDTO taskSearchDTO);

    List<ScriptInfo2> getTaskScriptInfo(Integer taskId);

    ResponseResult newTaskSchedule(TaskDTO taskDTO) throws Exception;
    ResponseResult newTaskSchedule(TaskCreateRequest taskReq) throws Exception;
    ResponseResult resetTaskSchedule(TaskDTO taskDTO) throws Exception;

    int newAutoTaskHistory(TaskDTO taskDTO);

    TaskDTO getTaskById(Integer taskId);
    TaskDTO queryTaskById(Integer taskId);
    TaskDTO getTaskHistoryById(Integer taskId);
    TaskDTO getTaskHistoryById2(Integer taskId);

    boolean removeTaskNotFoundJob(Integer taskId);

    int taskFailById(Integer id, String failReason);

    int interrupterWhenExecing(String duid);

    ResponseResult execTask(TaskExecDTO taskDTO);

    ResponseResult cancelTask(Integer id);

    ResponseResult removeTask(Integer id);

    ResponseResult taskComplete(TaskDataDTO taskDataDTO);

    int triggerTaskJob(Integer taskId);

    void modifyTaskJob(Integer oldTaskId,TaskDTO newTaskDTO) throws Exception;

    TaskDTO getLastTaskHistoryByTaskId(Integer taskId);

    Map<String, Object> getTaskUserInfoById(Integer taskId);

    int taskExecing(Integer historyTaskId);

    ResponseResult taskProcess(TaskProcessDTO taskProcessDTO);

    void taskChangedAfterStartTask(TaskExecDTO taskExecDTO);

    void createTask (TaskCreateRequest taskReq, TaskDTO taskDTO, Integer userId) throws Exception;

    List<TaskDTO> getTaskListByMasterComputerId(Integer masterComputerId, Integer projectId, Date startTime, Date endTime);

    void exportPdf(Integer taskId, HttpServletResponse response);

    void exportMemoryReport(Integer taskId, HttpServletResponse response);

    ExcelDataVo getExcelDataVoForMemory(Integer taskId);

    ExcelDataVo getExcelDataVoForTop(Integer taskId);

    ExcelDataVo getExcelDataVoForHMI(TaskDTO task);

    void exportTopReport(Integer taskId, HttpServletResponse response);

    void exportHmiReport(ExcelReportRequest reportRequest,HttpServletResponse response);

    List<ExcelDataVo.SheetData> buildHmiColdStartDetailSheet(TaskDTO task);

    ExcelDataVo.StatisticSheetData<ReportHmiStartRecord> buildHmiStartSheetData(TaskDTO task);

    ResponseResult createAutoTestTask(AutoTestTaskExecDTO autoTestTaskExecDTO) throws Exception;

    ResponseResult reportPerformance(TerminalPerformanceInfo tpInfo);

//    ResponseResult getReportPerformanceInfo(Integer taskId);

    ResponseResult queryPackageRecord(PackageRecord packageRecord);

    ResponseResult delPackageRecord(  PackageRecord packageRecord);

    ResponseResult addPackageRecord( PackageRecord packageRecord);

}
